package cn.iocoder.yudao.module.resource.dal.mysql.audiocommand;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.resource.dal.dataobject.audiocommand.AudioCommandDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.resource.controller.admin.audiocommand.vo.*;

/**
 * 语音指令配置 Mapper
 *
 * @author cai
 */
@Mapper
public interface AudioCommandMapper extends BaseMapperX<AudioCommandDO> {

    default PageResult<AudioCommandDO> selectPage(AudioCommandPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AudioCommandDO>()
                .eqIfPresent(AudioCommandDO::getCmdTitle, reqVO.getCmdTitle())
                .eqIfPresent(AudioCommandDO::getKeyword, reqVO.getKeyword())
                .eqIfPresent(AudioCommandDO::getSensorType, reqVO.getSensorType())
                .eqIfPresent(AudioCommandDO::getOperateType, reqVO.getOperateType())
                .eqIfPresent(AudioCommandDO::getStep, reqVO.getStep())
                .eqIfPresent(AudioCommandDO::getEnable, reqVO.getEnable())
                .eqIfPresent(AudioCommandDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(AudioCommandDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AudioCommandDO::getId));
    }

}